package utility;

public class Item {
	// Toa do hien tai
	private int currentCol;
	private int currentRow;


	// Toa do truoc do
	private int previousCol;
	private int previousRow;

	// Kieu hien thi cua quan co (quan trang hay quan den)
	private int index;

	public Item() {
		currentCol = -1;
		currentRow = -1;
		previousCol = -1;
		previousRow = -1;
		index = -1;
	}

	public Item(Item item) {
		currentCol = item.getCurrentCol();
		currentRow = item.getCurrentRow();
		previousCol = item.getPreviousCol();
		previousRow = item.getPreviousRow();
		index = item.getIndex();
	}

	public boolean isSame(Item item) {
		return (item != null && item.getCurrentCol() == this.getCurrentCol()
				&& item.getCurrentRow() == this.getCurrentRow()
				&& item.getIndex() == this.getIndex()
				&& item.getPreviousCol() == this.getPreviousCol() && item
					.getPreviousRow() == this.getPreviousRow());
	}

	public boolean isAlly(Item item) {
		boolean isEquals = false;
		if (item != null) {
			isEquals = (this.getIndex() == item.getIndex());
		}
		return isEquals;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public int getCurrentCol() {
		return currentCol;
	}

	public int getCurrentRow() {
		return currentRow;
	}

	public int getPreviousCol() {
		return previousCol;
	}

	public int getPreviousRow() {
		return previousRow;
	}

	public void setCurrentCol(int currentCol) {
		this.currentCol = currentCol;
	}

	public void setCurrentRow(int currentRow) {
		this.currentRow = currentRow;
	}

	public void setPreviousCol(int previousCol) {
		this.previousCol = previousCol;
	}

	public void setPreviousRow(int previousRow) {
		this.previousRow = previousRow;
	}

}
